CC = gcc
CFLAGS = -Wall -g

TARGET1 = SHARE-MEM-WRITE
SRCS1 = write.c
OBJS1 = $(SRCS1:.c=.o)

TARGET2 = SHARE-MEM-READ
SRCS2 = read.c
OBJS2 = $(SRCS2:.c=.o)

all: $(TARGET1) $(TARGET2)

$(TARGET1): $(OBJS1)
	$(CC) $(CFLAGS) -o $(TARGET1) $(OBJS1)

$(TARGET2): $(OBJS2)
	$(CC) $(CFLAGS) -o $(TARGET2) $(OBJS2)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -f $(OBJS1) $(TARGET1)
	rm -f $(OBJS2) $(TARGET2)